/********************************************************/
/*	Copyright (C) 2016 Gong Li Bin			*/
/*	Project:	GlbCloud			*/
/*	Author:		gong_libin			*/
/*	Date:		2013_05_21			*/
/*	File:		MrThash.cpp			*/
/********************************************************/

#include "MrThash.h"

CMrThash::CMrThash()
{
}

CMrThash::~CMrThash()
{
}

void CMrThash::MrThashDelete()
{
	m_CLock.MrLockDelete();
	CMrHash::MrHashDelete();

	return;
}

int CMrThash::MrThashCreate(key_t iKey, ULONG ulHash)
{
	int iReturn = MR_SUCCESS;

	if (MR_SUCCESS == m_CLock.MrLockMalloc(NULL)) {
		if (MR_SUCCESS == m_CLock.MrLockCreate(false)) {
			if (MR_SUCCESS != CMrHash::MrHashCreate(iKey, ulHash)) {
				iReturn = MR_FAILURE;
			}
		}
		else {
			iReturn = MR_FAILURE;
		}
	}
	else {
		iReturn = MR_FAILURE;
	}

	return iReturn;
}

int CMrThash::MrThashLock()
{
	return m_CLock.MrLockLock();
}

int CMrThash::MrThashUnlock()
{
	return m_CLock.MrLockUnlock();
}
